預設情況下,row或column沿其main axis會使用盡可能多的空間,但如果你想把children widget緊緊地包在一起,可以將mainAxisSize設成MainAxisSize.min
Row(
  mainAxisSize: MainAxisSize.min,
  children: [
    Icon(Icons.star, color: Colors.green[500]),
    Icon(Icons.star, color: Colors.green[500]),
    Icon(Icons.star, color: Colors.green[500]),
    const Icon(Icons.star, color: Colors.black),
    const Icon(Icons.star, color: Colors.black),
  ],
)

上面的程式碼就是使用MainAxisSize.min將star icon緊密排列在一起
flutter有非常多種類的widget,前面介紹了各種widget排版會用到的基礎,接下來我會介紹各種常用的widget,一般常看到的widget來自widget library,然而有些比較特殊的會來自Material library
container最重要的功能就是裝飾widget,如上面所述,可以添加padding、邊距、邊框、背景顏色或其他裝飾在widget上,可以使用decoration屬性裡的BoxDecoration()
Widget _buildImageColumn() {
  return Container(
    decoration: const BoxDecoration(
      color: Colors.black26,
    ),
    child: Column(
      children: [
        _buildImageRow(1),
        _buildImageRow(3),
      ],
    ),
  );
}

參考資料:
https://docs.flutter.dev/development/ui/layout